/*
 * @Author       : DeaneChen
 * @Date         : 2021-08-19 11:07:56
 * @LastEditTime : 2021-08-19 13:32:22
 * @LastEditors  : DeaneChen
 * @Description  : 
 * @FilePath     : \master_controller\Hardware\usart.h
 * HomePage     : https://luheqiu.com
 */
#ifndef __USART_H
#define __USART_H

#include "system.h"

#define FRAME_BYTE_LENGTH 5    //串口通讯一帧数据的字节数（含帧头和帧尾）
#define FRAME_START 0xA5       //帧头
#define FRAME_END   0x5A       //帧尾
#define ENABLE_FRAME_CHECKSUM  //启用校验和

extern uint8_t USART_Rx1Buff[FRAME_BYTE_LENGTH]; //接收缓冲区
extern uint8_t USART_Rx1Data[FRAME_BYTE_LENGTH]; //接收数据区
extern uint8_t USART_Rx1FrameFlag; //接收完整数据帧标志，1完整，0不完整

void USART1_Init(void);
void USART1_GetChar(uint8_t nChar);
void USART_OUT(USART_TypeDef* USARTx, uint8_t *Data);
uint8_t USART1_Process(uint8_t info);

#endif
